def divide(a, b):
    class DivisionByZeroError(ZeroDivisionError):
        pass
    
    if not isinstance(b,(int,float)) or abs(b - 0)<1e-7 :
       raise DivisionByZeroError("除数不能为零")

    return a / b

try:
   result=divide(6,0)
except DivisionByZeroError as errormsg:
   print(f"遇到了特殊异常:{errormsg}")
else:
   print(f"结果是{result}")
finally:
   print("无论如何都会执行此段落.")